import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';

class OkToast{

    static singleToast(String text,{Duration duration,}){
        var w = Center(
            child: Container(
                decoration:BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(4.0)),
                    color: Colors.black.withOpacity(0.7),
                ),
                padding: const EdgeInsets.all(10),
                child: Row(
                    mainAxisSize: MainAxisSize.min,
                    children: <Widget>[
                        Text(
                            text,
                            style: TextStyle(
                                color: Colors.white,
                                fontSize: 20,
                            ),
                        ),
                    ],
                ),
            ),
        );
        if(duration == null?true:false){
            showToastWidget(w);
        }else{
            showToastWidget(w,duration:duration);
        }
       
    }

    static closeAllToast(){
        dismissAllToast();
    }



}

// showToastWidget(w,duration:const Duration(seconds: 60));